﻿@using Microsoft.Web.Mvc
@model IEnumerable<TeamCityMonitor.Models.Notification>

@{
    ViewBag.Title = "Index";
    Layout = "../Admin/Layout.cshtml";
}

<h2 class="center">Notifications</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            ImageUrl
        </th>
        <th>
            Text
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @if(String.IsNullOrEmpty(@item.ImageUrl) == false )
            {
                @Html.Image(@item.ImageUrl, "");
            }
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Text)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
